{% extends "base.jinja" %}

{% block title %}系统通知_{% endblock %}

{% block css %},notice.css{% endblock %}

{% block main %}
<div class="page" id="notice-main">
	<div class="nm-nav">
		<h3>消息</h3>
		<ul>
			<li>
				<a href="/u/message/">系统通知{% if total_count %}
					<b>{{total_count}}</b>{% endif %}
				</a>
			</li>
		</ul>
	</div>
	<div class="nm-main">
		<h4>系统通知</h4>
		<ul class="nm-item">
			{% if notice_data %}
				{% for notice in notice_data %}
				<li {% if not notice.has_read %}class="nmi-unread"{%endif%}>
					<div class="nmi-avatar">
						<img src="http://s.lovewith.me/static/images/notice-system.gif" />
					</div>
					<div class="nmi-main">
						<a href="/u/message/?nid={{notice.id}}" title="点击查看详情">
							<p>{% autoescape off %}{{notice.title|e|replace('[b]', '<b>')|replace('[/b]', '</b>')}}{% endautoescape %}</p>
							<span>{{notice.notice_date|date('Y-m-d H:i:s')}}</span>
						</a>
					</div>
					<a href="javascript:;" class="ui nmi-del" data-nid="{{notice.id}}" title="删除"></a>
				</li>
				{% endfor %}
			{% else %}
				<div class="nm-empty">没有{% if notice_type == 'unread' %}未读{% endif %}通知</div>
			{% endif %}
		</ul>
	</div>

	{% if total_count > page_size %}
		<div class="nm-page">
			<a href="javascript:;" data-action="getmore" data-service="/u/ajax/g/notice/?p=" data-action="getmore" data-pagesize="{{page_size}}" data-page="1">更多</a>
		</div>
	{% endif %}
</div>
{% endblock %}

{% block script %}
<script>seajs.use('page/notice', function(p){p.render()});</script>
{% endblock %}
